import 'package:flutter/material.dart';

class Menu extends StatefulWidget {
  const Menu({super.key});

  @override
  State<Menu> createState() => _MenuState();
}

class _MenuState extends State<Menu> {
  @override
  Widget build(BuildContext context) {
    return Drawer(
        elevation: 16.0,
        child: Stack(
          children: <Widget>[
            Column(
              children: <Widget>[
                UserAccountsDrawerHeader(
                  accountName: const Text('name:xxxx'),
                  accountEmail: const Text('email:22222@163.com'),
                  // arrowColor: Colors.red,
                  onDetailsPressed: () {
                    print(1);
                  },
                  // decoration: const BoxDecoration(
                  //   image: DecorationImage(
                  //       image: NetworkImage(
                  //           'http://pic36.nipic.com/20131203/3822951_102145644000_2.jpg'),
                  //       fit: BoxFit.cover),
                  // ),
                ),
                Expanded(
                  child: ListView(
                    padding: const EdgeInsets.symmetric(vertical: 10.0),
                    children: const <Widget>[
                      ListTile(
                        leading: Icon(Icons.location_on),
                        title: Text('附近的人'),
                      ),
                      Divider(),
                      ListTile(
                        leading: Icon(Icons.settings),
                        title: Text('设置'),
                      ),
                    ],
                  ),
                ),
              ],
            ),
            Positioned(
                bottom: 10,
                right: 10,
                child: InkWell(
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      IconButton(
                        icon: const Icon(Icons.power_settings_new),
                        onPressed: () {},
                      ),
                      const Text('退出')
                    ],
                  ),
                  onTap: () => Navigator.pop(context),
                ))
          ],
        ));
  }
}
